import http from "@/http";
import axios from "axios";
// 权益中心
export function getList(params) {
  return http({
    url: "/yk/interests/list",
    method: "post",
    data: params
  });
}

// 所有权益中心
export function getRightList(params) {
  return http({
    url: "/yk/recordExchange/list",
    method: "post",
    data: params
  });
}

// 权益详情
export function getRightDetail(params) {
  return http({
    url: "/yk/recordExchange/info",
    method: "post",
    data: params
  });
}

// 油卡 立即兑换
export function exchange(params) {
  return http({
    url: "/yk/oil/exchange",
    method: "post",
    data: params
  });
}

// 获取微信提现到账金额
export function getWeChatCash(params) {
  return http({
    url: "/yk/interests/getWeChatCash",
    method: "post",
    data: params
  });
}

//
export function getPay(params) {
  return http({
    url: "/yk/wx/pay",
    method: "post",
    data: params
  });
}

// 获取微信提现到账金额
export function getWeTakecash(params) {
  // let result = axios.get(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxbe777fa292e776e0&redirect_uri=http://uslife.wicp.net/oilCard/wx/pay?id=${params}&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect`);
  let result = axios.get(
    `/pay/connect/oauth2/authorize?appid=wxbe777fa292e776e0&redirect_uri=http://xb.shengshidalian.com/yk/wx/pay?id=${params}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
  );

  // return axios({
  //   // url: 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxbe777fa292e776e0&redirect_uri=http://uslife.wicp.net/oilCard/wx/pay?id=' + params + '&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect',
  //   url: `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxbe777fa292e776e0&redirect_uri=http://uslife.wicp.net/oilCard/wx/pay?id=${params}&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect`,
  //   method: "get"
  // });
  return result;
}

// 油卡兑换
export function getOilCount() {
  return http({
    url: "/yk/oil/moneysCount",
    method: "post"
  });
}
